home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Include / thread.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  1.1 KB  |  50 lines  |  [TEXT/R*ch]

  1. #ifndef _THREAD_H_included
  2. #define _THREAD_H_included
  3.  
  4. #define NO_EXIT_PROG        /* don't define exit_prog() */
  5.                 /* (the result is no use of signals on SGI) */
  6.  
  7. #ifndef Py_PROTO
  8. #if defined(__STDC__) || defined(__cplusplus)
  9. #define Py_PROTO(args)    args
  10. #else
  11. #define Py_PROTO(args)    ()
  12. #endif
  13. #endif
  14.  
  15. typedef void *type_lock;
  16. typedef void *type_sema;
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. void init_thread Py_PROTO((void));
  23. int start_new_thread Py_PROTO((void (*)(void *), void *));
  24. void exit_thread Py_PROTO((void));
  25. void _exit_thread Py_PROTO((void));
  26. long get_thread_ident Py_PROTO((void));
  27.  
  28. type_lock allocate_lock Py_PROTO((void));
  29. void free_lock Py_PROTO((type_lock));
  30. int acquire_lock Py_PROTO((type_lock, int));
  31. #define WAIT_LOCK    1
  32. #define NOWAIT_LOCK    0
  33. void release_lock Py_PROTO((type_lock));
  34.  
  35. type_sema allocate_sema Py_PROTO((int));
  36. void free_sema Py_PROTO((type_sema));
  37. void down_sema Py_PROTO((type_sema));
  38. void up_sema Py_PROTO((type_sema));
  39.  
  40. #ifndef NO_EXIT_PROG
  41. void exit_prog Py_PROTO((int));
  42. void _exit_prog Py_PROTO((int));
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48.  
  49. #endif
  50.